﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.SessionState;
using GWEB.WebBase.Entity;
using GWEB.WebBase.Utility;
using GWEB.WebFrame.Public;

namespace GWEB.WebFrame.Models
{
    public class Grant
    {
        public PageInfo Init()
        {
            PageInfo pg = new PageInfo();
            HttpSessionState session = System.Web.HttpContext.Current.Session;
            pg.dict = BasePage.getDict(session);
            pg.Type = "Grant";
            pg.Title = "权限管理";
            pg.EditText = "权限设置";
            pg.LocateText = "权限信息查询";
            pg.SMenuId = "CS02";
            pg.FileUrl = "../Sys/Grant";
            pg.Condition = "";
            pg.TableName = "tb_sys_grand";
            pg.KeyFieldName = "id";
            pg.PopEditHeight = 500;
            pg.PopEditWidth = 360;
            pg.Sop = BasePage.Grant(session, pg.SMenuId);
            pg.Sop.ADD = false; pg.Sop.DEL = false; pg.Sop.EXPORT = false;
            pg.Sop.EDIT_htm = "<li id=\"btn_mod\" onclick=\"edit()\" class=\"layui-btn layui-btn-normal\"><i class='layui-icon layui-icon-set-sm'></i>权限设置</li>";
            pg.Tab.Add("角色", "LocatePara='';UrlEditPara='type=GrantRole';OrderField='id';DataPageUrl='../Main/DataPageLay?type=GrantRole&isCheck=0';GoPage(1);");
            pg.Tab.Add("用户", "LocatePara='';UrlEditPara='type=GrantUser';OrderField='id';DataPageUrl='../Main/DataPageLay?type=GrantUser&isCheck=0';GoPage(1);");
            ColumnInfo cl;
            cl = new ColumnInfo(); cl.DataType = Tag.Text; cl.FieldName = "name"; cl.HeadText = "名称"; cl.IsCondition = true; pg.AddColumn(cl);
            return pg;
        }
    }
}